#!/bin/sh
# -*- shell-script -*-
# Copyright (C) 2004-2022 GraphicsMagick Group
# Test ICC Transforms
. ./common.shi
. ${top_srcdir}/utilities/tests/common.sh

# Number of tests we plan to execute
test_plan_fn 3

ORIGINAL_PROFILE=sunrise_out.icc
IMAGE_OUTPUT=ICCTransform_out.miff

rm -f ${ORIGINAL_PROFILE}
rm -f ${IMAGE_OUTPUT}
test_command_fn 'Extract ICC profile' ${GM} convert ${SUNRISE_MIFF} ${ORIGINAL_PROFILE}
test_command_fn 'Apply ICC profile and then reverse it' -F LCMS ${GM} convert ${SUNRISE_MIFF} -debug Transform -profile ${BETARGB_PROFILE} -profile ${ORIGINAL_PROFILE} -compress ${MIFF_COMPRESS} ${IMAGE_OUTPUT}
test_command_fn 'Verify results' ${GM} compare -maximum-error 0.004 -metric MAE ${SUNRISE_MIFF} ${IMAGE_OUTPUT}
:
